import config from '@/config'

export function getPreviewPath(id){
	if(id.startsWith('http')){
		return id;
	}
	return config.replacehUrl('imgStore/openApi/previewByBussId?bussid=' + id )
}

export function getToken(){
	return uni.getStorageSync("token");
}

export function notAuthToast(){
	uni.showToast({
		title: '未授权，请先登录',
		mask: true,
		icon: 'none'
	})
}


export function clearImageListCache(){
	uni.removeStorageSync('imageList');
}
export function setImageListCache(imageList){
	uni.setStorageSync('imageList', imageList);
}
export function getImageListCache(){
	return uni.getStorageSync('imageList');
}
